package ball
{	
	import flash.display.MovieClip;
	import interfaces.IBall;
	
	public class BallBase extends MovieClip implements IBall
	{
//-----------------------------------------------------------------------------------------------PUBLIC---------------------------------
													//================ Properties ===============
		public function set pos(p:int):void{
			_pos=p;
		}
		public function get pos():int{
			return _pos;
		}
		public function set speed(v:int):void{
			_speed=v;
		}
		public function get speed():int{
			return _speed;
		}
		public function set addSpeed(a:int):void{
			_addSpeed=a;
		}
		public function get addSpeed():int{
			return _addSpeed;
		}
		public function set roadData(r:Array):void{
			_roadData=r;
		}
		public function get roadData():Array{
			return _roadData;
		}
													
													//================ Public Methods ===========
		public function BallBase(){
			initVar();
		}		
		public function update():void{
			_speed+=_addSpeed;
			_pos+=_speed;
			this.x=_roadData[_pos].x;
			this.y=_roadData[_pos].y;
		}
//-----------------------------------------------------------------------------------------------PRIVATE--------------------------------
													
													//================ Properties ===============
		private var _pos:int;
		private var _speed:int;
		private var _addSpeed:int;
		private var _roadData:Array;
													//================ Private Methods ==========
		/**
		 *继承需要重写这个函数，给球的运动属性赋值；
		 */		
		protected function initVar():void{
		}
	}
}